package com.un.ebs.product.domain;

import com.un.ebs.product.enums.ProductUnitTypeEnum;
import com.un.ebs.product.enums.SkuItemDeliverTypeEnum;
import com.un.ebs.product.enums.ProductSaleTypeEnum;
import java.util.Date;
import com.un.ebs.product.enums.ProductPurchaseTypeEnum;
import com.un.ebs.product.enums.ProductChargeTypeEnum;
import com.un.ebs.product.enums.ProductPriceConfirmTypeEnum;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.springframework.stereotype.Component;
import lombok.Data;
import com.un.ebs.core.metadata.DbField;

/**
 * (Product)表实体类
 *
 * @author liubo
 * @since 2020-12-12 22:24:09
 */
@Data
@Component
@TableName("tb_product")
@SuppressWarnings("serial")
public class Product extends Model<Product> {

    @TableId(value = "id", type = IdType.UUID)
    private String id;


    @DbField(name = "code", length = 40, precision = 0)
    private String code;

    @DbField(name = "name", length = 100, precision = 0)
    private String name;

    @DbField(name = "class_id", length = 40, precision = 0)
    private String classId;

    @DbField(name = "unit_type", length = -1, precision = 0)
    private ProductUnitTypeEnum unitType;

    @DbField(name = "charge_type", length = -1, precision = 0)
    private ProductChargeTypeEnum chargeType;

    @DbField(name = "charge_min_money", length = 10, precision = 4)
    private Double chargeMinMoney;

    @DbField(name = "price", length = 18, precision = 0)
    private Double price;

    @TableLogic
    @DbField(name = "is_delete", length = -1, precision = 0)
    private Boolean isDelete;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_time", length = -1, precision = 0)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_at", length = 40, precision = 0)
    private String createAt;

    @TableField(fill = FieldFill.UPDATE)
    @DbField(name = "last_modified_time", length = -1, precision = 0)
    private Date lastModifiedTime;

    @TableField(fill = FieldFill.UPDATE)
    @DbField(name = "last_modified_at", length = 40, precision = 0)
    private String lastModifiedAt;

    @DbField(name = "tenant_id", length = 40, precision = 0)
    private String tenantId;

    @DbField(name = "is_sale", length = -1, precision = 0)
    private Boolean isSale;

    @DbField(name = "price_confirm_type", length = -1, precision = 0)
    private ProductPriceConfirmTypeEnum priceConfirmType;

    @DbField(name = "deliver_ready_time", length = 10, precision = 0)
    private String deliverReadyTime;

    @DbField(name = "sale_start", length = -1, precision = 0)
    private Date saleStart;

    @DbField(name = "sale_end", length = -1, precision = 0)
    private Date saleEnd;

    @DbField(name = "deliver_start", length = -1, precision = 0)
    private Date deliverStart;

    @DbField(name = "deliver_end", length = -1, precision = 0)
    private Date deliverEnd;

    @DbField(name = "remark", length = 2000, precision = 0)
    private String remark;

    @DbField(name = "deliver_type", length = -1, precision = 0)
    private SkuItemDeliverTypeEnum deliverType;

    @DbField(name = "sale_type", length = -1, precision = 0)
    private ProductSaleTypeEnum saleType;

    @DbField(name = "buy_min_qty", length = -1, precision = 0)
    private Integer buyMinQty;

    @DbField(name = "buy_max_qty", length = -1, precision = 0)
    private Integer buyMaxQty;

    @DbField(name = "is_deliver_audit_status", length = -1, precision = 0)
    private Boolean isDeliverAuditStatus;

    @DbField(name = "is_deliver_flow", length = -1, precision = 0)
    private Boolean isDeliverFlow;

    @DbField(name = "is_must_defunct_by_order", length = -1, precision = 0)
    private Boolean isMustDefunctByOrder;

    @DbField(name = "sort", length = -1, precision = 0)
    private Integer sort;

    @DbField(name = "is_book", length = -1, precision = 0)
    private Boolean isBook;

    @DbField(name = "pre_time_book_qty", length = -1, precision = 0)
    private Integer preTimeBookQty;

    @DbField(name = "purchase_type", length = -1, precision = 0)
    private ProductPurchaseTypeEnum purchaseType;

    @DbField(name = "is_must_defunct_tomb_sku_by_order", length = -1, precision = 0)
    private Boolean isMustDefunctTombSkuByOrder;

    @DbField(name = "production_seq_id", length = 40, precision = 0)
    private String productionSeqId;

    @DbField(name = "sale_large_class_id", length = 40, precision = 0)
    private String saleLargeClassId;

    @DbField(name = "sale_medium_class_id", length = 40, precision = 0)
    private String saleMediumClassId;

    @DbField(name = "sale_small_class_id", length = 40, precision = 0)
    private String saleSmallClassId;

    @DbField(name = "warehouse_desc", length = 100, precision = 0)
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String warehouseDesc;

    @DbField(name = "purchase_quality_proportion", length = 18, precision = 0)
    private double purchaseQualityProportion;

    @DbField(name = "sale_quality_proportion", length = 18, precision = 0)
    private double saleQualityProportion;

    @DbField(name = "production_quality_proportion", length = 18, precision = 0)
    private double productionQualityProportion;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}